package pos.domain;

import java.util.List;

public class TypeImpl implements Type{

	private String idType;
	private String name;
//	private Entity entity;
	private List<SubType> listSubTypes;
	
	public TypeImpl(String idType, String name, List<SubType> listSubTypes) {
		super();
		this.idType = idType;
		this.name = name;
		this.listSubTypes = listSubTypes;
	}
	
	public TypeImpl() {

	}

	public String getId() {
		return idType;
	}
	public String getName() {
		return name;
	}
//	public Entity getEntity(){
//		return entity;
//	}
	public List<SubType> getListSubTypes(){
		return listSubTypes;
	}
	
	public void setId(String idType) {
		this.idType = idType;
	}
	public void setName(String name) {
		this.name = name;
	}
//	public void setEntity(Entity entity){
//		this.entity = entity;
//	}
	public void setListSubTypes(List<SubType> listSubTypes){
		this.listSubTypes = listSubTypes;
	}

	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((idType == null) ? 0 : idType.hashCode());
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		return result;
	}

	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		TypeImpl other = (TypeImpl) obj;
		if (idType == null) {
			if (other.idType != null)
				return false;
		} else if (!idType.equals(other.idType))
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		return true;
	}

	public String toString() {
		return "TypeImpl [idType=" + idType + ", name=" + name + ", listSubTypes="+ listSubTypes + "]";
	}
	
}

